<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

<ui:composition>

    <p:dialog header="Editar crédito bancário" widgetVar="edit_credit" resizable="false" showEffect="clip" hideEffect="clip" modal="true" position="top" width="440">
        <h:panelGrid id="panel_edit_credit" columns="2" style="margin-bottom:10px">
            <h:outputLabel for="updateCreditValue" value="Valor:" />
            <h:inputText id="updateCreditValue" value="#{financesDashboardMBean.selectedCredit.value}" />

            <h:outputLabel for="updateCreditDescription" value="Descrição:" />
            <h:inputText id="updateCreditDescription" value="#{financesDashboardMBean.selectedCredit.description}"/>
        </h:panelGrid>
        <br/>
        <p:commandButton value="Confirmar" update="growl, dataTableBankAccount, dataTableCredit" actionListener="#{financesDashboardMBean.updateCredit}" oncomplete="edit_credit.hide();"/>
        <p:commandButton value="Cancelar" oncomplete="edit_credit.hide();"/>
    </p:dialog>

    <p:dialog header="Criar crédito bancário" widgetVar="create_credit" resizable="false" showEffect="clip" hideEffect="clip" modal="true" position="top">
        <h:panelGrid id="panel_create_credit" columns="2" style="margin-bottom:10px">

            <h:outputLabel for="menuBankAccount" value="Conta:" />
            <h:selectOneMenu id="menuBankAccount" value="#{financesDashboardMBean.optionMenuBankAccount}">
                <f:selectItems value="#{financesDashboardMBean.menuBankAccount}"/>
            </h:selectOneMenu>

            <h:outputLabel for="createCreditValue" value="Valor:" />
            <h:inputText id="createCreditValue" value="#{financesDashboardMBean.createCredit.value}" />

            <h:outputLabel for="createCreditDescription" value="Descrição:" />
            <h:inputText id="createCreditDescription" value="#{financesDashboardMBean.createCredit.description}" />
        </h:panelGrid>
        <p:commandButton value="Confirmar" update="growl, dataTableBankAccount, dataTableCredit" actionListener="#{financesDashboardMBean.createCredit}" oncomplete="create_credit.hide();"/>
        <p:commandButton value="Cancelar" oncomplete="create_credit.hide();"/>
    </p:dialog>

</ui:composition>
</html>